﻿#ifndef MYSPLITTER_H
#define MYSPLITTER_H

#include <QSplitter>
#include <QByteArray>
#include <functional>

class EagleMainFrame;
class CSimulaPlayDlg;
class BaseDisParentWnd;

class MySplitter : public QSplitter
{
	Q_OBJECT

public:
	MySplitter(QWidget *parent);
	~MySplitter();

	virtual QPaintEngine * paintEngine() const;

	virtual bool eventFilter(QObject *watched, QEvent *event);

	void InitSplitter(int nWidth);

	void setMain(EagleMainFrame* caller)
	{
		m_pMainFrame = caller;
	}

	void setSimuMain(CSimulaPlayDlg* dlg)
	{
		m_pSimuDlg = dlg;
	}

	typedef std::function<void(BaseDisParentWnd*)> pfCaller;

	pfCaller getNormalCaller();

	virtual void paintEvent(QPaintEvent *event);

	void setSimuMode();

public slots:
	void on_viewNormal();
	void on_viewDisplay();
	void on_viewCCDList();
	void on_viewRECList();

signals:

	void evt_showCCD();
	void evt_showRec();

private:
	bool m_bSimulate;
	QByteArray m_state;
	bool m_bFullScreen;
	QWidget* m_curFullWnd;
	QWidget* m_preParent;
	QList<int> m_WndSizes;
	EagleMainFrame* m_pMainFrame;
	CSimulaPlayDlg* m_pSimuDlg;
};

#endif // MYSPLITTER_H
